package com.cloud.wms.ui.inside.entity;

import android.os.Parcel;

import com.cloud.wms.ui.main.entity.MemberEntity;

import java.util.ArrayList;

/**
 * @Author:Chen
 * @Date: 2021-03-05 14:37
 * @Description:
 */
public class ReplenishOrderEntity extends MemberEntity {

    private String replenishCode;
    private long replenishID;
    private String needSKUAmount;
    private String needAmount;
    private String createDate;
    private ArrayList<ReplenishCommodityEntity> commodityEntities;

    public ArrayList<ReplenishCommodityEntity> getCommodityEntities() {
        return commodityEntities;
    }

    public void setCommodityEntities(ArrayList<ReplenishCommodityEntity> commodityEntities) {
        this.commodityEntities = commodityEntities;
    }

    public String getReplenishCode() {
        return replenishCode == null ? "" : replenishCode;
    }

    public void setReplenishCode(String replenishCode) {
        this.replenishCode = replenishCode;
    }

    public long getReplenishID() {
        return replenishID;
    }

    public void setReplenishID(long replenishID) {
        this.replenishID = replenishID;
    }

    public String getNeedSKUAmount() {
        return needSKUAmount == null ? "" : needSKUAmount;
    }

    public void setNeedSKUAmount(String needSKUAmount) {
        this.needSKUAmount = needSKUAmount;
    }

    public String getNeedAmount() {
        return needAmount == null ? "" : needAmount;
    }

    public void setNeedAmount(String needAmount) {
        this.needAmount = needAmount;
    }

    public String getCreateDate() {
        return createDate == null ? "" : createDate.replace("T", " ");
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public ReplenishOrderEntity() {
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        super.writeToParcel(dest, flags);
        dest.writeString(this.replenishCode);
        dest.writeLong(this.replenishID);
        dest.writeString(this.needSKUAmount);
        dest.writeString(this.needAmount);
        dest.writeString(this.createDate);
        dest.writeTypedList(this.commodityEntities);
    }

    protected ReplenishOrderEntity(Parcel in) {
        super(in);
        this.replenishCode = in.readString();
        this.replenishID = in.readLong();
        this.needSKUAmount = in.readString();
        this.needAmount = in.readString();
        this.createDate = in.readString();
        this.commodityEntities = in.createTypedArrayList(ReplenishCommodityEntity.CREATOR);
    }

    public static final Creator<ReplenishOrderEntity> CREATOR = new Creator<ReplenishOrderEntity>() {
        @Override
        public ReplenishOrderEntity createFromParcel(Parcel source) {
            return new ReplenishOrderEntity(source);
        }

        @Override
        public ReplenishOrderEntity[] newArray(int size) {
            return new ReplenishOrderEntity[size];
        }
    };
}
